package com.happy.study.servier.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.happy.study.dao.CategoryMapper;
import com.happy.study.entity.CategoryEntity;
import com.happy.study.servier.ICategoryService;
import com.happy.study.util.StateEnum;
import com.happy.study.util.StateException;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: Wuzh
 * @Description:
 * @Date Created in 15:33 2021/1/23
 * @return
 */
@Service
public class CategoryServiceImpl extends ServiceImpl<CategoryMapper, CategoryEntity> implements ICategoryService {

    @Override
    public List<CategoryEntity> queryList ( CategoryEntity categoryEntity ) {
        if ( categoryEntity == null ) {
            throw new StateException ( StateEnum.REQUEST_PARAM_EXCE );
        }
        List<CategoryEntity> categoryEntities = baseMapper.selectList ( new QueryWrapper<> () );
        return categoryEntities;
    }
}
